package org.dxy.domain.event.workstation;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Value;
import org.dxy.domain.event.AggregateTypeEnum;
import org.dxy.domain.event.DomainEvent;

import java.time.LocalDateTime;

/**
 * @description:
 * @author: dxy
 * @createTime: 2025/6/18 21:03
 */
@Value
@Builder
@AllArgsConstructor
public class WorkstationStepCompletedEvent implements DomainEvent {
    Long workstationId;       // 工位ID
    Long stepId;              // 当前工艺步骤ID
    String stepName;          // 步骤名称（可选，便于日志审计）
    LocalDateTime completedAt; // 步骤完成时间
    
    @Override
    public Long aggregateId() {
        return workstationId;
    }
    
    @Override
    public String aggregateType() {
        return AggregateTypeEnum.WORKSTATION.getKey();
    }
    
    @Override
    public String eventType() {
        return WorkstationEventTypeEnum.STEP_COMPLETED.getKey();
    }
}
